/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class TestDemo {
    public static void main(String[] args) {
        int[] arr = {1,2,3};
        String ret = toString(arr);
        System.out.println(ret);
    }

    public static String toString(int[] arr){
        System.out.print("[");
        String ret = " ";
        for (int i = 0; i < arr.length; i++) {
            if(i != arr.length-1){
                System.out.print(arr[i]+",");
            }else{
                System.out.print(arr[i]+"]");
            }
        }
        return ret;
    }
}
